#!/bin/bash

SERVER=xayoudao.com
SERVER_PATH=yunkelai
PWD=`pwd`
echo $PWD$SERVER_PATH

rm -rf server.tar.gz
echo release package

tar zcvf server.tar.gz --exclude='images' --exclude='uploads' --exclude='docs' --exclude='.git' --exclude='._.DS_Store' --exclude='.DS_Store' --exclude='._.gitignore' --exclude='.gitignore' --exclude='server.tar.gz' --exclude='s' --exclude='*.db' --exclude='protected/apples-group.json' --exclude='assets/' .

echo package success , start upload!

scp server.tar.gz root@xayoudao.com:/alidata/www/$SERVER_PATH/
ssh root@xayoudao.com /alidata/www/$SERVER_PATH/deploy.sh
rm -rf server.tar.gz
echo main server success!!

#scp server.tar.gz root@xayoudao.com:/alidata/www/yaoba/
#ssh root@xayoudao.com '/alidata/www/yaoba/deploy.sh'
#echo second server success !!

echo success!
say success! &
